package net.shop.dal.dao.jdbc;

import java.io.Serializable;

import javax.annotation.PostConstruct;
import javax.annotation.Resource;
import javax.sql.DataSource;

import org.springframework.jdbc.core.simple.SimpleJdbcDaoSupport;

import net.shop.dal.dao.BaseDao;

public abstract class JdbcBaseDao<T, PK extends Serializable> extends SimpleJdbcDaoSupport implements BaseDao<T, PK> {
	
    @Resource
    private DataSource dataSource;
    
    @PostConstruct
    public void initDataSource() {
    	setDataSource(dataSource);
    	afterSetDataSource();
    }
    
    protected void afterSetDataSource() {
    	//child class over
    }
}
